<template>
	<view class="tn-safe-area-inset-bottom">
		<!-- 顶部自定义导航 -->
		<tn-nav-bar fixed alpha customBack>
			<view slot="back" class='tn-custom-nav-bar__back'>
				<text class='icon tn-icon-left' @click="goBack"></text>
				<text class='icon tn-icon-home-capsule-fill' @click="goHome"></text>
			</view>
		</tn-nav-bar>

		<view class="tn-search-fixed" style="background: linear-gradient(180deg, #D8E5FF, #FFFFFF);">
			<view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin"
				:style="{paddingTop: vuex_custom_bar_height + 'px'}">

				<view class="justify-content-item align-content-item" style="width: 100vw;">
					<view class="tn-flex tn-flex-col-center"
						style="border: 1rpx solid #3668fc;border-radius: 100rpx;padding: 10rpx 20rpx 10rpx 20rpx;width: 90%;">
						<text
							class="tn-icon-search justify-content-item tn-padding-right-xs tn-color-gray tn-text-lg"></text>
						<input class="justify-content-item" placeholder="请输入搜索内容" name="input" v-model="inputValue"
							placeholder-style="color:#AAAAAA" style="width: 90%;"></input>
					</view>
				</view>

				<view class="align-content-item">
					<view class="justify-content-item tn-text-center">
						<tn-button backgroundColor="#3668fc" shape="round" padding="20rpx 20rpx" width="150rpx"
							@tap="getPaperList()">
							<text class="tn-color-white">搜 索</text>
						</tn-button>
					</view>
				</view>
			</view>
		</view>
		<view class="" style="margin-top: 100rpx;" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
			<lm-order-list :orderList="paperList"></lm-order-list>
		</view>

	</view>

</template>

<script>
	import template_page_mixin from '@/libs/mixin/template_page_mixin.js'
	import {
		getOrderStatusList
	} from "@/api";
	export default {
		name: 'TemplateSearch',
		mixins: [template_page_mixin],
		data() {
			return {
				inputValue: '',
				paperList: [],
				pageNum: 1,
				pageSize: 10,
				orderFlow: global.staticDict.orderFlow
			}
		},
		async onShow() {
			this.getPaperList()
		},
		methods: {
			async getPaperList() {
				try {

					//查询待支付的订单
					const res = await getOrderStatusList(this.orderFlow.statusWaitPay, this.inputValue);
					this.paperList = res.data ?? []
					this.paperList.forEach(item => {
						if (item.technicalSelection == '') {
							item.techList = []
						} else {
							item.techList = item.technicalSelection.split(',')
						}
						if (item.includingServices == '') {
							item.servicesList = []
						} else {
							item.servicesList = item.includingServices.split(',')
						}
					})
					console.log(this.paperList, 'paperList')
				} catch (e) {
					console.log(e)
				}

			},
			// 跳转
			tn(e) {
				uni.navigateTo({
					url: e,
				});
			},
			//触底刷新
			onReachBottom() {
				console.log("触底刷新")
				this.getPaperList()
				// this.getRandomData()
			},
		}
	}
</script>

<style lang="scss" scoped>
	/* 胶囊*/
	.tn-custom-nav-bar__back {
		width: 100%;
		height: 100%;
		position: relative;
		display: flex;
		justify-content: space-evenly;
		align-items: center;
		box-sizing: border-box;
		background-color: rgba(0, 0, 0, 0.15);
		border-radius: 1000rpx;
		border: 1rpx solid rgba(255, 255, 255, 0.5);
		color: #FFFFFF;
		font-size: 18px;

		.icon {
			display: block;
			flex: 1;
			margin: auto;
			text-align: center;
		}

		&:before {
			content: " ";
			width: 1rpx;
			height: 110%;
			position: absolute;
			top: 22.5%;
			left: 0;
			right: 0;
			margin: auto;
			transform: scale(0.5);
			transform-origin: 0 0;
			pointer-events: none;
			box-sizing: border-box;
			opacity: 0.7;
			background-color: #FFFFFF;
		}
	}

	.tn-search-fixed {
		position: fixed;
		top: 0rpx;
		width: 100%;
		transition: all 0.25s ease-out;
		z-index: 1;
	}


	/* 搜索标签 start*/
	.tn-tag-search {
		&__item {
			display: inline-block;
			line-height: 45rpx;
			padding: 10rpx 30rpx;
			margin: 20rpx 20rpx 5rpx 0rpx;

			&--prefix {
				padding-right: 10rpx;
			}
		}
	}

	/* 标签内容 end*/

	/* 标题 start */
	.nav_title {
		-webkit-background-clip: text;
		color: transparent;

		&--wrap {
			position: relative;
			display: flex;
			height: 120rpx;
			font-size: 42rpx;
			align-items: center;
			justify-content: center;
			font-weight: bold;
			background-image: url(https://resource.tuniaokj.com/images/title_bg/title00.png);
			background-size: cover;
		}
	}

	/* 标题 end */

	/* 富文本图示意 start */
	.news-img {
		z-index: -1;
		padding-bottom: 40rpx;

		image {
			width: 100%;
			margin: 20rpx 0;
			// height: 3373rpx;
			// z-index: -1;
		}
	}

	/* 资讯主图 start*/
	.image-article {
		border-radius: 8rpx;
		border: 1rpx solid #F8F7F8;
		width: 200rpx;
		height: 200rpx;
		position: relative;
	}

	.image-pic {
		background-size: cover;
		background-repeat: no-repeat;
		// background-attachment:fixed;
		background-position: top;
		border-radius: 10rpx;
	}

	.article-shadow {
		border-radius: 15rpx;
		box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.07);
	}

	/* 文字截取*/
	.clamp-text-1 {
		-webkit-line-clamp: 1;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-overflow: ellipsis;
		overflow: hidden;
	}

	.clamp-text-2 {
		-webkit-line-clamp: 2;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-overflow: ellipsis;
		overflow: hidden;
	}

	/* 标签内容 start*/
	.tn-tag-content {
		&__item {
			display: inline-block;
			line-height: 35rpx;
			color: #1D2541;
			background-color: #F3F2F7;
			border-radius: 10rpx;
			font-size: 22rpx;
			padding: 5rpx 15rpx;

			&--prefix {
				padding-right: 10rpx;
			}
		}
	}
</style>